//
//  BaseVModel.swift
//  nurseApp
//
//  Created by cyptt on 2023/3/21.
//

import UIKit

public typealias ViewModelSuccessBlock = (_ vModelResult:Any) -> Void
public typealias ViewModelSFailBlock = ( _ vModelFailMsg:String) -> Void

//isMoreData 是否加重更多数据 isMoreData = true 是
public typealias ViewModelMoreDataSuccessBlock = (_ vModelResult:Any,_ isMoreData:Bool?) -> Void
open class CHBaseVModel: NSObject {

  
    public var datas:[Any] = []
    public var successBlock:ViewModelSuccessBlock?
    public var successMoreDataBlock:ViewModelMoreDataSuccessBlock?
    public var failBlock:ViewModelSFailBlock?
    
    /*
     正常流程
     */
    public init(successBlock: ViewModelSuccessBlock? = nil, failBlock: ViewModelSFailBlock? = nil) {
        self.successBlock = successBlock
        self.failBlock = failBlock
    }
    open  func refreshData(){
        
    }
    
    /*
     下拉加载更多情况
     */
    public init(successBlock: ViewModelMoreDataSuccessBlock? = nil, failBlock: ViewModelSFailBlock? = nil) {
        self.successMoreDataBlock = successBlock
        self.failBlock = failBlock
    }
    
    
  
    
    //isMoreData 是否加重更多数据 isMoreData = true 是
    open  func refreshData(isMoreData:Bool = false){
        
    }
}
